<%@ page import="com.hrm.entity.EmployeeEntity" %>
<%@ page import="com.hrm.dto.Envelope" %>
<%@ page import="com.hrm.entity.InfoEntity" %><%--
  Created by IntelliJ IDEA.
  User: zekdot
  Date: 20-2-26
  Time: 下午12:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>个人信息</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/table.css">
    <link href="${pageContext.request.contextPath}/css/main.css" rel="stylesheet" type="text/css">
</head>

<body>
<%
    // 获取用户身份
    Object role = session.getAttribute("user");
    EmployeeEntity employeeEntity = null;
    // 如果用户身份不是雇员
    InfoEntity infoEntity = null;
    if(role == null || !role.getClass().equals(EmployeeEntity.class)){
//        response.sendRedirect("/index.jsp");//.forward(request,response);
    }else{
        employeeEntity = (EmployeeEntity) role;
        Envelope envelope = (Envelope) request.getAttribute("param");
        infoEntity = (InfoEntity) envelope.getObj();
    }
%>
<%
    if(employeeEntity != null){
%>
<div class="div_form">
    <h1 class="h1_style"><i class="i_h1"></i>个人档案</h1>
    <form id="form_demo" >
        <p class="form_p"><label class="form_label">id：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=employeeEntity.getId()%>">
        </p>
        <p class="form_p"><label class="form_label">姓名：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getName()%>">
        </p>
        <p class="form_p"><label class="form_label">性别：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getGender()%>">
        </p>
        <p class="form_p"><label class="form_label">年龄：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getAge()%>">
        </p>
        <p class="form_p"><label class="form_label">联系方式：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getContact()%>">
        </p>
        <p class="form_p"><label class="form_label">部门：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=employeeEntity.getDepartment()%>">
        </p>
        <p class="form_p"><label class="form_label">职位：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=employeeEntity.getPosition()%>">
        </p>
        <p class="form_p"><label class="form_label">状态：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=employeeEntity.getStatus()==0?"在职":"离职"%>">
        </p>
        <p class="form_p"><label class="form_label">政治面貌：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getNation()%>">
        </p>
        <p class="form_p"><label class="form_label">文化程度：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getEducation()%>">
        </p>
        <p class="form_p"><label class="form_label">毕业院校：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getGraduation()%>">
        </p>
        <p class="form_p"><label class="form_label">籍贯：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getOrigin()%>">
        </p>
        <p class="form_p"><label class="form_label">入职日期：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getInDate()%>">
        </p>
        <p class="form_p"><label class="form_label">离职日期：</label>
            <input type="text" class="form_input readonly" readonly="readonly" value="<%=infoEntity.getOutDate().equals("")?"未离职":infoEntity.getOutDate()%>">
        </p>

    </form>


</div>









<%
    }
%>

</body>
</html>
